home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-10 | 1.0 KB | 38 lines | [TEXT/GEOL] |
- Item 6794167 10-Oct-89 15:45
-
- From: ROTH2 Roth, Eric
-
- To: MACAPP.TECH$ MACAPP Tech
-
- Sub: object type coercion
-
- I think this is an easy one:
-
- I want to subclass TPopup to have some extra behavior. The Demo Dialogs
- example contains the following code:
-
- VAR aPopup: TPopup;
- ...
- aPopup := TPopup(DoCreateViews(NIL, aDialogView, cPopupExample, gZeroVPt));
-
-
- which works fine. When I create
-
- TMyPopup = OBJECT (TPopup)
-
- and then
-
- Var aMyPopup: TMyPopup;
- ...
- aMyPopup := TMyPopup(DoCreateViews(...));
-
- I get an object type coercion error. 'DoCreateViews' returns a TView. TPopup
- is a TControl which is a TView. How is the coercion from a TView to a TMyPopup
- different from the first assignment, coercing from TView to TPopup? (Don't
- tell me it's one level too many....) Is there something about the resource
- definition of the popup view that has to match up with the new subclass?
-
- Thanks is advance,
- Eric
-
-